import { get, post } from "../utils/request";
import type { AdminLogin, AdminInfo } from "../utils/types";
const login = (data: AdminLogin) => post("admin/login", data);

const adminList = () => get("admin/list");

const addAdmin = (data: AdminInfo) => post("admin/add", data);

const selectAdmin = (adminname: string) => get("admin/detail", { adminname });

const updateAdmin = (data: AdminInfo) => post("admin/update", data);

const deleteAdmin = (adminid: string) => post("admin/delete", { adminid });

export default {
  login,
  adminList,
  addAdmin,
  selectAdmin,
  updateAdmin,
  deleteAdmin,
};
